package pub.interceptors;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
import pub.util.ResponseUtil;

public class ResponseInterceptor implements HandlerExceptionResolver {
	public ModelAndView resolveException(HttpServletRequest request,
			HttpServletResponse response, Object arg2,
			Exception AjaxApplicationException) {
		PrintWriter out = null;
		try {
			out = response.getWriter();
//			out.print(ResponseUtil.resultMsg(AjaxApplicationException.getMessage()));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			out.close();
		}
		return null;
	}
}